Skip to content

fix(cli): wait for background tasks in run#28047

Open
PeterPonyu wants to merge 1 commit into
anomalyco:devfrom
PeterPonyu:fix/opencode-26062-run-background-wait
Open

fix(cli): wait for background tasks in run#28047
PeterPonyu wants to merge 1 commit into
anomalyco:devfrom
PeterPonyu:fix/opencode-26062-run-background-wait

Conversation

@PeterPonyu
Copy link
Copy Markdown

@PeterPonyu PeterPonyu commented May 17, 2026

Issue for this PR

Closes #26062

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Keeps non-interactive opencode run subscribed while background task child sessions are still running. This lets injected background results resume the parent session instead of returning as soon as the parent becomes idle.

Adds a regression test for the parent-idle/background-child sequence.

How did you verify your code works?

  • bun test test/cli/run/noninteractive-background.test.ts test/cli/run/stream.transport.test.ts test/cli/run/subagent-data.test.ts test/tool/task.test.ts
  • bun typecheck
  • git diff --check
  • pre-push repo-wide bun turbo typecheck

Screenshots / recordings

N/A, CLI behavior change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] SESSION END WHEN WAIT FOR BACKGROUND TASK

1 participant